using System;
using System.Linq.Expressions;
using LinqSpecs;

namespace PCE.Data.Queries
{
	internal class WithAthentication : Specification<Domain.Customer>
	{
		private readonly string _login;
		private readonly string _password;

		public WithAthentication(string login, string password)
		{
			_login = login.ToUpper();
			_password = password;
		}

		public override Expression<Func<Domain.Customer, bool>> IsSatisfiedBy()
		{
			return c => c.Login.ToUpper() == _login && c.Password == _password;
		}
	}
}